package wzh.crm.ui.menu;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import wzh.crm.R;

/**
 * TODO: document your custom view class.
 */
public class MenuItem extends RelativeLayout {
    private ImageView icon;
    private TextView title;
    private TextView detail;

    public MenuItem(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.item_menu, this);
        icon= (ImageView) findViewById(R.id.menu_item_icon);
        title= (TextView) findViewById(R.id.menu_item_title);
        detail=(TextView) findViewById(R.id.menu_item_detail);

    }

    public void setIconResource(int id) {
        icon.setImageResource(id);
    }

    public void setTitle(String text) {
        title.setText(text);
    }

    public void setDetail(String text) {
        this.detail.setText(text);
    }

}
